Skip to content

Runs finish without a person: stacked bases, registries, stalled tasks, waits and CI rounds - #796

Merged
nambok merged 8 commits into
mainfrom
runs-finish-without-a-person
Nov 22, 2026
Merged

nambok merged 8 commits into
mainfrom
runs-finish-without-a-person

Conversation

@nambok

@nambok nambok commented Nov 21, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Failed, stuck and repeated runs were traced to the code paths that stopped them, using the run records, events, per-pass conversations and worker logs. Most were already fixed on main by an earlier change, which is named with its test below. This PR fixes the causes that main still has. Each fix comes with a test that fails on main and passes here.

Already fixed on main, no change here:

Changes

Stacked pull requests (fa_stacked_pr_targets_its_base). Two tickets built the same change, so commits with the same patch id read as copies of the sibling's open pull request, and every retry stopped on them. Main now rebuilds the change on the sibling's branch, but two gaps were left:

  • A reused or reopened pull request never moved off its old base. It now moves onto the branch it is stacked on, but only when that branch is another open pull request's branch in the same repository.
  • A branch whose shared commits are all the sibling's own commits (the same hashes) was rebuilt and force pushed on every retry. It is now taken as built on that branch.

New-feature rules (rg_registered_where_the_kind_grows). A "registry" was judged from a sample of 8 siblings and a list of folder names. That let a one-off backfill outside migrations/, or a generated types file, block a pull request. A real registry kept under migrations/ was never checked. A registry is now told by what the file is:

  • it names more than half of all the siblings;
  • it is program code (not prose, a test, or a generator's output);
  • its history shows it gained entries as the kind grew.

A file that lists the kind but never grew is only noted, and so is one whose history can't be read. Neither blocks.

Stalled tasks (dq_unfinished_stop_ships). When continuations stopped finishing planned tasks after the supervisor had changed approach, the guard "handed it to you". The stop then stayed on the run, so the next red CI ended the run without a fix. That stop now ships what is done, defers the open tasks on the pull request with the reason, and is taken back once the work is on the pull request. Spend, pass transitions and the run ceilings stay hard stops.

Waiting on a person (dj_new_run_ends_earlier_waits, stuck-run sweep tests).

  • The sweep measured a wait from the run's last update, which its own reminder moved, so every wait was reminded daily. A long wait got a reminder every day. A wait is now measured from when it began and reminded once.
  • The sweep's scan never read ask_default, ask_deadline or ask_default_taken_at, so no stated default was ever taken. It reads them now.
  • An alarm's gate compared the alert text with a hash of a different text, so they never matched. Each firing started a run beside the one still waiting. A new firing is now a reopen: it starts nothing while the alert's run waits, reports an outside change, or has its pull request open.
  • When a fresh run of a ticket takes its claim, the ticket's earlier runs still waiting in the same repository become retried and point to it.

CI fix rounds (fd_red_ci_not_the_changes, fe_round_work_round_trips).

  • A red check found without a webhook event was described as "Workflow 'unknown' failed (run_id: 0)". It carried no check name, so no comparison, log read or re-run happened. It is now recorded with its checks, workflow names and run ids.
  • A deploy that hit a limit of the team's cloud account (for example a load balancer quota) went to code fix rounds, and once took the run's own work out. It is now named on the pull request with the repository's cleanup workflow, and no code is changed for it. Only AWS's own error codes count: a browser's QuotaExceededError or a client's TooManyRedirects from the code under test is still the change's failure.
  • Contents URLs did not encode path segments. A folder whose name holds a percent-encoded character read as 404, that 404 read as a missing WIP branch, and the branch holding the round's work was deleted. Paths are now encoded at every contents call, and a file 404 is no longer a missing branch.
  • A new CI or review round reset coderhelm-wip/<branch> to the pull request head, which threw away up to 20 checkpoint commits. A round now continues from that branch when it sits exactly on the head.

Verification

Each new incident case or test was run against origin/main and fails there:

  • fa: does not compile on main; the functions it needs do not exist.
  • rg: 3 of 3 fail on main's rule.
  • dq: fails with "a CoderHelm limit ships what is done".
  • dj and the gateway alert test: the gateway test fails with "needs_input started a second run"; dj does not compile on main.
  • Sweep tests: 2 fail on main.
  • fd and fe: 9 of 9 fail on main's behaviour.

Gates, run locally on this branch as CI runs them:

Gate Result
cargo fmt --all --check clean
cargo clippy --workspace --all-targets -- -D warnings clean
cargo test --workspace --no-fail-fast common 2892, gateway 1149, worker 2361 passed, 0 failed
python3 -m unittest discover -s lambda/tests 582 passed

Still open, not in this PR:

  • In a CI fix round, every sandbox command is a full build of about 90 to 130 seconds, so a round fits only about four.
  • An already-recorded "needs a person" precondition still gets CI fix rounds.
  • Retry and Start over on a run whose pull request is open start the ticket over.
  • A generator that can't run for a reason other than time still stops before the pull request.
  • The open-PR coverage check is skipped when the ticket asks for a separate change.

Two tickets asked for the same change, and two runs built it from the
default branch with one commit per file written. Several of their commits
had the same patch id, so the first ticket's kept branch read as copying
the sibling's open pull request. Its retries continued the same kept
branch and stopped before the pull request step on old code. Today the
change is rebuilt on the other branch and the run stacks on it, but two
gaps were left:

- A pull request the run reuses (its own open one, or a reopened one)
  never moved off its old base. Its diff showed the other pull request's
  whole change beside this one, while its description said it was stacked
  and showed only this change. It now moves onto the run's base when that
  base is another open pull request's branch of the repository; any other
  base is left alone.
- On the next attempt, whose base starts again from the default branch,
  the other pull request's own commits on the branch (the same hashes)
  read as copies and the change was rebuilt and force pushed again. A
  branch whose shared commits are all the other pull request's own is
  built on it: the run takes that branch as its base and rebuilds nothing.

Incident case fa_stacked_pr_targets_its_base.
…ld by what the file is

Two new-feature runs were blocked "new items aren't registered everywhere
their siblings are" for places that register nothing: a one-off data
migration that lists the document types it rewrote, and a package.json that
names UI libraries as dependencies. The rule called a file a registry when
it named most of a sample of eight siblings (the first eight by name), and
told places apart by folder names (migrations/, docs/, fixtures/). So a
backfill kept in any other folder, or a generated types file, still counted,
and a real index of migrations never did.

A registry is now told by what the file is:

- it lists the kind: more than half of all the existing siblings (never a
  sample), by path or as whole strings; a kebab-case name such as
  `boat-index` no longer counts as naming `boat`;
- it is part of the program: not prose, a test or its fixtures, a file the
  repository's own generators write (read from their config), or a file
  whose head says it is generated (it is regenerated, never edited);
- it grew with the kind: its history on the default branch shows it naming
  fewer of the siblings when it was written than now. A file that lists
  them but never grew is noted for a person with why; one whose history
  can't be read isn't checked. Neither blocks.

Only a checked registry blocks, and the coder is first told to add the
entry itself. Incident case rg replays both runs' shapes; three of its
checks fail on the code before this change.
… it back

The guard's count of continuations without a finished task fired one step
after the supervisor's ladder deferred the first stuck task, with words that
hand the work to a person ("it continued 7 times without finishing another
task ... Push to the branch"). The draft it opened shipped the work, but the
stop stayed on the run, so the pull request's CI fix round and ready decision
hit the stop on their first pass and the run ended failed instead of fixed.

That stop is now a shipping stop like the converged one: its reason says
what shipped and that the open tasks are deferred with why, and it is taken
back once the work is on its pull request. Spend, pass transitions and the
run ceilings stay hard stops. Incident dq replays the stuck run's steps
through the step marks, the ladder and the guard.
…ing again never starts a second run; a fresh run ends its ticket's earlier waits

The stuck-run sweep measured a wait from the run's last update, which its own reminder moved, so every wait was reminded daily; and its scan never read the default and deadline fields, so no stated default was ever taken. An alarm's gate compared two different texts, so each firing started a run beside the one still waiting. A run waiting on a person was not live, so a new trigger took the ticket over and left the old wait behind.
…e per check

The stacked-base helpers landed between reopen_prior_pr and its doc comment, so the comment described the wrong function. The new-feature check read the same candidate's commit history again for each new item it checked; it is now read once per check.
…unds keep their work

- A ci_failed event written without a webhook (a missed webhook, a
  straggler, a redrive) reads the failing checks from GitHub and carries
  each workflow's name, run id, conclusion and failing jobs, so the fix
  round reads the job log, can re-run it and compares it against the base.
  No failure is described as "Workflow 'unknown' failed (run_id: 0)".
- A failure whose log shows a limit of the cloud account (TooMany...,
  ...LimitExceeded, ...QuotaExceeded, "reached the maximum number of") is
  not the change's: no fix round or re-run, nothing taken out; the pull
  request says so and names the repository's cleanup workflow.
- Every contents URL percent-encodes each path segment and the ref, so a
  path like `%5Fmarkdown/[[...slug]]` reads the file it names.
- A file GitHub won't give back is not a missing WIP branch: the branch and
  its work are kept, and the CI fix loop deletes the branch only for a
  fault that calls for a clean start.
- A new CI or review fix round on a head where an unfinished round left
  checkpoints goes on from that WIP branch instead of resetting it.

Incidents: fd_red_ci_not_the_changes, fe_round_work_round_trips.
A browser's QuotaExceededError or a client's TooManyRedirects thrown by the code under test is the change's failure. Reading those words anywhere in a log as the account's limit would have marked a pull request ready with its bug in it. Only the code in an AWS CLI 'An error occurred (Code)' line, or an SDK's ...Exception, counts.
@nambok
nambok merged commit be37f79 into main Nov 22, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant